home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 22 / CU Amiga Magazine's Super CD-ROM 22 (1998)(EMAP Images)(GB)[!][issue 1998-05].iso / PowerPC / Programming / PPCSmallEiffel / lib_se / run_control.e < prev    next >
Encoding:
Text File  |  1998-01-16  |  3.9 KB  |  184 lines

  1. --          This file is part of SmallEiffel The GNU Eiffel Compiler.
  2. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  3. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr 
  4. --                       http://www.loria.fr/SmallEiffel
  5. -- SmallEiffel is  free  software;  you can  redistribute it and/or modify it 
  6. -- under the terms of the GNU General Public License as published by the Free
  7. -- Software  Foundation;  either  version  2, or (at your option)  any  later 
  8. -- version. SmallEiffel is distributed in the hope that it will be useful,but
  9. -- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. -- or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU General Public License 
  11. -- for  more  details.  You  should  have  received a copy of the GNU General 
  12. -- Public  License  along  with  SmallEiffel;  see the file COPYING.  If not,
  13. -- write to the  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. -- Boston, MA 02111-1307, USA.
  15. --
  16. class RUN_CONTROL
  17.    --
  18.    -- Selection of Eiffel run time options.
  19.    --
  20.    
  21. inherit GLOBALS;
  22.    
  23. creation make
  24.    
  25. feature {NONE} -- Numbering of levels are those of E.T.L. (pp 133) :
  26.    
  27.    level: INTEGER;
  28.      -- Actual level of checking;
  29.    
  30.    level_no: INTEGER is -5;
  31.      -- No assertion checking of any kind.
  32.    
  33.    level_require: INTEGER is -4; 
  34.      -- Evaluate the preconditions.
  35.    
  36.    level_ensure: INTEGER is -3;
  37.      -- Also evaluate postconditions.
  38.          
  39.    level_invariant: INTEGER is -2;
  40.      -- Also evaluate the class invariant on entry to and return from.
  41.    
  42.    level_loop: INTEGER is -1;
  43.      -- Also evaluate the loop variant and the loop invariant.
  44.    
  45.    level_check_all: INTEGER is 0;
  46.      -- Also evaluate the check instruction.
  47.      -- The default value.
  48.             
  49.    level_check_debug: INTEGER is 1;
  50.      -- Also evaluate the debug instruction.
  51.             
  52.    level_boost: INTEGER is -6;
  53.      -- BOOST :-). Very very speed level. 
  54.      -- Do not check for Void target.
  55.      -- Do not check system level validity.
  56.         
  57.    make is do end;
  58.    
  59. feature  -- Consultation :
  60.  
  61.    trace: BOOLEAN;
  62.      -- Flag for trace mode.
  63.  
  64.    boost: BOOLEAN is
  65.       do
  66.      Result := level = level_boost;
  67.       end;
  68.    
  69.    no_check: BOOLEAN is
  70.       do
  71.      Result := level >= level_no;
  72.       end;
  73.    
  74.    require_check: BOOLEAN is
  75.       do
  76.      Result := level >= level_require;
  77.       end;
  78.    
  79.    ensure_check: BOOLEAN is
  80.       do
  81.      Result := level >= level_ensure;
  82.       end;
  83.    
  84.    invariant_check: BOOLEAN is
  85.       do
  86.      Result := level >= level_invariant;
  87.       end;
  88.    
  89.    loop_check: BOOLEAN is
  90.       do
  91.      Result := level >= level_loop;
  92.       end;
  93.    
  94.    all_check: BOOLEAN is
  95.       do
  96.      Result := level >= level_check_all;
  97.       end;
  98.    
  99.    debug_check: BOOLEAN is
  100.       do
  101.      Result := level = level_check_debug;
  102.       end;
  103.    
  104.    root_class: STRING;
  105.      -- Name given in the system command line to find 
  106.      -- the root class.
  107.    
  108. feature -- Setting :
  109.    
  110.    set_boost is  
  111.       do
  112.      level := level_boost;
  113.       end;
  114.    
  115.    set_no_check is
  116.       do
  117.      level := level_no;
  118.       end;
  119.    
  120.    set_require_check is
  121.       do
  122.      level := level_require;
  123.       end;
  124.    
  125.    set_ensure_check is
  126.       do
  127.      level := level_ensure;
  128.       end;
  129.    
  130.    set_invariant_check is
  131.       do
  132.      level := level_invariant;
  133.       end;
  134.    
  135.    set_loop_check is
  136.       do
  137.      level := level_loop;
  138.       end;
  139.    
  140.    set_all_check is
  141.       do
  142.      level := level_check_all;
  143.       end;
  144.    
  145.    set_debug_check is
  146.       do
  147.      level := level_check_debug;
  148.       end;
  149.    
  150.    set_root_class(rc: STRING) is
  151.       require
  152.      rc /= Void;
  153.       do
  154.      root_class := rc;
  155.       ensure
  156.      root_class = rc;
  157.       end;
  158.  
  159.    set_trace is
  160.       do
  161.      trace := true;
  162.       end;
  163.  
  164. feature -- Other settings :
  165.  
  166.    set_cecil_path(path: STRING) is
  167.       do
  168.      cecil_path := path;
  169.       ensure
  170.      cecil_path = path
  171.       end;
  172.  
  173.    cecil_path: STRING; 
  174.      -- Not Void when option -cecil used.
  175.  
  176. invariant
  177.    
  178.    level_boost <= level ;
  179.    
  180.    level <= level_check_debug;
  181.    
  182. end -- RUN_CONTROL
  183.  
  184.